﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;
using BookStore.Solution.BLL;
using BookStore.Solution.Entities;

namespace BookStore.Solution.Presentation
{
    public partial class frmSearchEntryBillBySupplier : DevComponents.DotNetBar.OfficeForm
    {
        public frmSearchEntryBillBySupplier()
        {
            InitializeComponent();
        }
        public string status { get; set; }
        public string supplierID { get;set;}
        private void btnSearch_Click(object sender, EventArgs e)
        {
            supplierID = cbbSupplier.SelectedValue.ToString();
            this.status = "close";
            Close();
        }

        private void frmSearchEntryBillBySupplier_Load(object sender, EventArgs e)
        {
            SupplierManager supplier = new SupplierManager();
            cbbSupplier.DataSource = supplier.GetAll();
            cbbSupplier.DisplayMember = "SupplierName";
            cbbSupplier.ValueMember = "SupplierID";
            status = "";
        }

        private void frmSearchEntryBillBySupplier_FormClosed(object sender, FormClosedEventArgs e)
        {
            if (this.status.CompareTo("close") != 0)
            {
                DialogResult dl = MessageBox.Show("Bạn muốn hủy các thao tác tìm kiếm phiếu nhập theo mã", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                if (dl == DialogResult.Yes)
                {
                    this.status = "";
                    Close();
                }
            }
        }

     
    }
}